﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading;

namespace Common
{
    public class MD5
    {
        public static string FunEncrypt(string str)
        {
            byte[] array = Encoding.Default.GetBytes(str);
            array = new MD5CryptoServiceProvider().ComputeHash(array);
            string text = "";
            int i = 0;
            while (i < array.Length)
            {
                text += array[i].ToString("x").PadLeft(2, '0');
                Math.Max(Interlocked.Increment(ref i), checked(i - 1));
            }
            return text;
        }
    }
}
